<template>
<div>
  <van-nav-bar title="绑定住院人" left-text="返回"
               left-arrow  @click-left="back"/>
  <div>
    <van-form >
      <van-cell-group inset>
        <van-field
            v-model="obj.hzid"
            label="住院区"
            placeholder="请输入住院区"
            :rules="[{ required: true, message: '请填写住院区' }]"
        />
        <van-field
            v-model="obj.sid"
            label="住院科室"
            placeholder="请输入住院科室"
            :rules="[{ required: true, message: '请填写住院科室' }]"
        />
        <van-field
            v-model="obj.no"
            label="住院号"
            placeholder="请输入住院号"
            :rules="[{ required: true, message: '请填写住院号' }]"
        />
        <van-field name="radio" label="住院状态">
          <template #input>
            <van-radio-group v-model="obj.flag" direction="horizontal">
              <van-radio name="1">住院中</van-radio>
              <van-radio name="2">已出院</van-radio>
            </van-radio-group>
          </template>
        </van-field>
        <van-field
            v-model="obj.stime"
            is-link
            readonly
            label="入院时间"
        />
        <van-field
            v-model="obj.etime"
            is-link
            readonly
            label="出院时间"
        />

      </van-cell-group>

      <van-cell-group style="margin-top: 20px" inset>
        <van-field
            v-model="obj.name"
            label="就诊人"
            readonly
        />
        <van-field
            v-model="obj.cardType"
            label="证件类型"
            readonly
        />
        <van-field
            v-model="obj.cardNo"
            label="证件号"
            readonly
        />
        <van-field
            v-model="obj.phone"
            label="手机号"
            readonly
        />
        <van-field
            v-model="obj.pno"
            label="就诊卡号"
            readonly
        />
      </van-cell-group>

      <div style="margin: 16px;">
        <van-button round block type="primary" native-type="button" @click="tz">
          住院充值
        </van-button>
      </div>
    </van-form>


  </div>
</div>
</template>

<script setup>
import {ref,onMounted} from "vue";
import axios from "axios";
import {useRouter} from "vue-router";
import {useStore} from "vuex";
const store = useStore()
const router = useRouter()
const obj=store.state.hospitalized;

const back=()=>{
  history.back();
}
const tz = () => {
  router.push("/");
}
</script>

<style scoped>

</style>
